<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="../templates/ui.xhtml">
        
	<ui:define name="content">
		<h1 class="title ui-widget-header ui-corner-all">SlideMenu</h1>
		<div class="entry">
			<p>SlideMenu displays submenus in with slide animation similar to ipod menus.</p>
			
			<h:form>
			
				<p:growl id="messages"/>
                                
				<h3>Default SlideMenu</h3>
                <p:slideMenu style="width:180px">
					<p:submenu label="Ajax Menuitems" icon="ui-icon-refresh">
						<p:menuitem value="Save" actionListener="#{menuBean.save}" update="messages" icon="ui-icon-disk" />
						<p:menuitem value="Update" actionListener="#{menuBean.update}" update="messages" icon="ui-icon-arrowrefresh-1-w" />
					</p:submenu>
					<p:submenu label="Non-Ajax Menuitem" icon="ui-icon-newwin">
						<p:menuitem value="Delete" actionListener="#{menuBean.delete}"  ajax="false" icon="ui-icon-close"/>
					</p:submenu>
                    <p:separator />
					<p:submenu label="Navigations" icon="ui-icon-extlink">
						<p:submenu label="Prime Links">
							<p:menuitem value="Prime" url="http://www.prime.com.tr" />
							<p:menuitem value="PrimeFaces" url="http://www.primefaces.org" />
						</p:submenu>
                        <p:menuitem value="Mobile" outcome="/mobile/index" />
					</p:submenu>
				</p:slideMenu>
                
                <h3>Overlay</h3>
				<p:commandButton id="dynaButton" value="Show" type="button"/>
                <p:slideMenu overlay="true" trigger="dynaButton" my="left top" at="left bottom" style="width:180px">
					<p:submenu label="Ajax Menuitems">
						<p:menuitem value="Save" actionListener="#{menuBean.save}" update="messages" icon="ui-icon-disk"/>
						<p:menuitem value="Update" actionListener="#{menuBean.update}" update="messages" icon="ui-icon-arrowrefresh-1-w"/>
					</p:submenu>
					<p:submenu label="Non-Ajax Menuitem">
						<p:menuitem value="Delete" actionListener="#{menuBean.delete}"  ajax="false" icon="ui-icon-close"/>
					</p:submenu>
					<p:submenu label="Navigations" icon="ui-icon-extlink">
						<p:submenu label="Prime Links">
							<p:menuitem value="Prime" url="http://www.prime.com.tr" />
							<p:menuitem value="PrimeFaces" url="http://www.primefaces.org" />
						</p:submenu>
                        <p:menuitem value="Mobile" outcome="/mobile/index" />
					</p:submenu>
				</p:slideMenu>

            </h:form>
			
			<h3>Source</h3>
			<p:tabView>
				<p:tab title="slideMenu.xhtml">
                    <pre name="code" class="xml">
&lt;h:form&gt;
			
    &lt;p:growl id="messages"/&gt;

    &lt;h3&gt;Default SlideMenu&lt;/h3&gt;
    &lt;p:slideMenu style="width:180px"&gt;
        &lt;p:submenu label="Ajax Menuitems" icon="ui-icon-refresh"&gt;
            &lt;p:menuitem value="Save" actionListener="\#{menuBean.save}" update="messages" icon="ui-icon-disk" /&gt;
            &lt;p:menuitem value="Update" actionListener="\#{menuBean.update}" update="messages" icon="ui-icon-arrowrefresh-1-w" /&gt;
        &lt;/p:submenu&gt;
        &lt;p:submenu label="Non-Ajax Menuitem" icon="ui-icon-newwin"&gt;
            &lt;p:menuitem value="Delete" actionListener="\#{menuBean.delete}"  ajax="false" icon="ui-icon-close"/&gt;
        &lt;/p:submenu&gt;
        &lt;p:separator /&gt;
        &lt;p:submenu label="Navigations" icon="ui-icon-extlink"&gt;
            &lt;p:submenu label="Prime Links"&gt;
                &lt;p:menuitem value="Prime" url="http://www.prime.com.tr" /&gt;
                &lt;p:menuitem value="PrimeFaces" url="http://www.primefaces.org" /&gt;
            &lt;/p:submenu&gt;
            &lt;p:menuitem value="Mobile" outcome="/mobile/index" /&gt;
        &lt;/p:submenu&gt;
    &lt;/p:slideMenu&gt;

    &lt;h3&gt;Overlay&lt;/h3&gt;
    &lt;p:commandButton id="dynaButton" value="Show" type="button"/&gt;
    &lt;p:slideMenu overlay="true" trigger="dynaButton" my="left top" at="left bottom" style="width:180px"&gt;
        &lt;p:submenu label="Ajax Menuitems"&gt;
            &lt;p:menuitem value="Save" actionListener="\#{menuBean.save}" update="messages" icon="ui-icon-disk"/&gt;
            &lt;p:menuitem value="Update" actionListener="\#{menuBean.update}" update="messages" icon="ui-icon-arrowrefresh-1-w"/&gt;
        &lt;/p:submenu&gt;
        &lt;p:submenu label="Non-Ajax Menuitem"&gt;
            &lt;p:menuitem value="Delete" actionListener="\#{menuBean.delete}"  ajax="false" icon="ui-icon-close"/&gt;
        &lt;/p:submenu&gt;
        &lt;p:submenu label="Navigations" icon="ui-icon-extlink"&gt;
            &lt;p:submenu label="Prime Links"&gt;
                &lt;p:menuitem value="Prime" url="http://www.prime.com.tr" /&gt;
                &lt;p:menuitem value="PrimeFaces" url="http://www.primefaces.org" /&gt;
            &lt;/p:submenu&gt;
            &lt;p:menuitem value="Mobile" outcome="/mobile/index" /&gt;
        &lt;/p:submenu&gt;
    &lt;/p:slideMenu&gt;

&lt;/h:form&gt;
                    </pre>
				</p:tab>
                    
                <p:tab title="MenuBean.java">
                    <pre name="code" class="java">
package org.primefaces.examples.view;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

public class MenuBean {
    
    public void save() {
		addMessage("Data saved");
	}
	
	public void update() {
		addMessage("Data updated");
	}
	
	public void delete() {
		addMessage("Data deleted");
	}
	
	public void addMessage(String summary) {
		FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, summary,  null);
		FacesContext.getCurrentInstance().addMessage(null, message);
	}
}

                    </pre>
				</p:tab>
			</p:tabView>
      	</div>
 
</ui:define>
</ui:composition>
				